<template>
  <div class="live-assistant-content win-flex-column">
    <div class="oper_content pl10 pr10">
      <el-table :data="liveAssistantDataList" border>
        <el-table-column prop="dictKey" label="平台名称" width="120">
        </el-table-column>
        <el-table-column prop="dictValue" label="平台地址">
        </el-table-column>
        <el-table-column label="操作" align="center" width="170" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button size="mini" type="text" @click="openUrl(scope.row)">打开</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { getDictListByCategoryCode } from '@/api/sys/dict/data';
import { dictKey } from '@/enum/enums';
export default {
  name: 'LiveAssistant',
  components: {
  },
  data() {
    return {
      liveAssistantDataList: [],
    };
  },
  created() {
    this.getliveAssistantData();
  },
  computed: {
    pageConfig() {
      return this.$store.state.page.config;
    },
    liveAssistant() {
      return this.pageConfig.liveAssistant;
    }
  },
  methods: {
    openUrl(row) {
      window.open(row.dictValue);
    },
    getliveAssistantData() {
      getDictListByCategoryCode(dictKey.liveAssistantType).then(res => {
        this.liveAssistantDataList = res.result;
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.live-assistant-content {
  height: calc(100vh - 130px);
}
</style>
